//
//  NewsTableViewCell2.m
//  Mtime2.0
//
//  Created by 凉气的Mac on 16/9/21.
//  Copyright © 2016年 凉气的Mac. All rights reserved.
//

#import "NewsTableViewCell2.h"

@interface NewsTableViewCell2 ()

@property(nonatomic,weak) UIImageView *picture2;

@property(nonatomic,weak) UIImageView *picture3;

@end

@implementation NewsTableViewCell2

-(void)setupUI{

    [super setupUI];
    
    self.MyTextLabel.text = @"";
    
    self.titleLabel.numberOfLines = 1;
    
    self.picture.image = [UIImage imageNamed:@"icon_default_90x60"];
    
    [self.titleLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.top.left.equalTo(self.contentView).offset(15);
        
        make.right.equalTo(self.contentView).offset(-15);
        
    }];

    [self.picture mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.left.equalTo(self.titleLabel);
        
        make.top.equalTo(self.titleLabel.mas_bottom).offset(5);
        
        make.height.equalTo(@70);
        
        make.width.equalTo(self.contentView).multipliedBy(0.305);
        
    }];
    
    self.picture2 = [self addImageViewWithLeftView:self.picture];
    
    self.picture3 = [self addImageViewWithLeftView:self.picture2];
    
    [self.timeLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.left.equalTo(self.titleLabel);
        
        make.top.equalTo(self.picture.mas_bottom).offset(5);
        
        make.bottom.equalTo(self.contentView).offset(-10);
        
    }];
    
    [self.commentLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.left.equalTo(self.timeLabel.mas_right).offset(15);
        
        make.top.equalTo(self.picture.mas_bottom).offset(5);
        
        make.bottom.equalTo(self.contentView).offset(-10);
        
    }];

    
    
    
}

-(UIImageView *)addImageViewWithLeftView:(UIView *)leftView{

    UIImageView *picture2 = [[UIImageView alloc]init];
    
    picture2.image = [UIImage imageNamed:@"icon_default_90x60"];
    
    [self.contentView addSubview:picture2];
    
    [picture2 mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.height.width.equalTo(self.picture);
        
        make.left.equalTo(leftView.mas_right).offset(3);
    }];

    return picture2;

}

@end

































